<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>协同过滤</title>
    <link rel="stylesheet" href="css/pintuer.css">
    <link rel="stylesheet" href="css/admin.css">
    <script src="js/jquery.js"></script>
    <script src="js/pintuer.js"></script>
    <script type="text/javascript">
        function getfind() {
            $.post('/niitproject/getfind', {name:$('#name').val() }, function (data) {
                $("#recommend").empty(); // 清空表格
                data.forEach(function (user) {
                    var row = '<tr><td>' + user.name + '</td><td>' + user.recommend + '</td></tr>';
                    $("#recommend").append(row);
                });

            })
        }
        $(document).ready(function() {
            $('#search').click(function() {
                getfind();
                alert('搜索中...'); // 提供一个字符串参数给 alert()
            });
        });
    </script>

</head>
<body>
<form method="post" action="" id="listform">
    <div class="panel admin-panel">
        <div class="panel-head"><strong class="icon-reorder"> 学生列表</strong> <a href="" style="float:right; display:none;">添加字段</a></div>
        <div class="padding border-bottom">
            <ul class="search" style="padding-left:10px;">
                <form action="">
                <li>
                    姓名:
                    <input type="text" placeholder="请输入搜索关键字" name="keywords" id="name" class="input" style="width:250px; line-height:17px;display:inline-block" />
                    <a href="javascript:void(0)" class="button border-main icon-search" id="search" > 搜索</a>

                </li>
                </form>
            </ul>
        </div>
        <table class="table table-hover text-center" id="recommend">
            <tr>
                <th width="10%">姓名</th>
                <th width="10%">相似学生推荐</th>

            </tr>
            <tbody id="tb"></tbody>
            <tr>
                <td colspan="8"><div class="pagelist"> <a href="">上一页</a> <span class="current">1</span><a href="">2</a><a href="">3</a><a href="">下一页</a><a href="">尾页</a> </div></td>
            </tr>
        </table>
    </div>
</form>
</body>

</html>